Public Class Orders
    Inherits DABase

    Public Function GetOrderHistoryReportByType(ByVal startDate As DateTime, ByVal endDate As DateTime, ByVal CustomerID As Integer, ByVal SupplierCode As Integer) As DataSet
        Dim sqlCommand As New SqlClient.SqlCommand

        sqlCommand.CommandText = "[GetOrderHistoryReportByType]"
        sqlCommand.CommandType = System.Data.CommandType.StoredProcedure
        sqlCommand.Connection = Me.Connection
        sqlCommand.Transaction = Me.Transaction

        sqlCommand.Parameters.Add("@START_DATE", startDate)
        sqlCommand.Parameters.Add("@END_DATE", endDate)
        sqlCommand.Parameters.Add("@CUSTOMERID", CustomerID)
        sqlCommand.Parameters.Add("@SUPPLIER_CODE", SupplierCode)

        Dim ds As New DataSet

        Dim da As New SqlDataAdapter(sqlCommand)

        da.Fill(ds, "ORDER_REPORT_BY_TYPE")

        Return ds
    End Function

    Public Function GetOrderHistoryReportByProduct(ByVal startDate As DateTime, ByVal endDate As DateTime, ByVal CustomerID As Integer, ByVal productCode As Integer) As DataSet
        Dim sqlCommand As New SqlClient.SqlCommand

        sqlCommand.CommandText = "[GetOrderHistoryReportByProduct]"
        sqlCommand.CommandType = System.Data.CommandType.StoredProcedure
        sqlCommand.Connection = Me.Connection
        sqlCommand.Transaction = Me.Transaction

        sqlCommand.Parameters.Add("@START_DATE", startDate)
        sqlCommand.Parameters.Add("@END_DATE", endDate)
        sqlCommand.Parameters.Add("@CUSTOMERID", CustomerID)
        sqlCommand.Parameters.Add("@PRODUCT_CODE", productCode)

        Dim ds As New DataSet

        Dim da As New SqlDataAdapter(sqlCommand)

        da.Fill(ds, "ORDER_REPORT_BY_PRODUCT")

        Return ds
    End Function

    Public Function GetOrderHistoryReportByProduct(ByVal startDate As DateTime, ByVal endDate As DateTime, ByVal CustomerID As Integer, ByVal productCode As String) As DataSet
        Dim sqlCommand As New SqlClient.SqlCommand

        sqlCommand.CommandText = "[GetOrderHistoryReportByProduct]"
        sqlCommand.CommandType = System.Data.CommandType.StoredProcedure
        sqlCommand.Connection = Me.Connection
        sqlCommand.Transaction = Me.Transaction

        sqlCommand.Parameters.Add("@START_DATE", startDate)
        sqlCommand.Parameters.Add("@END_DATE", endDate)
        sqlCommand.Parameters.Add("@CUSTOMERID", CustomerID)
        sqlCommand.Parameters.Add("@PRODUCT_CODE", productCode)

        Dim ds As New DataSet

        Dim da As New SqlDataAdapter(sqlCommand)

        da.Fill(ds, "ORDER_REPORT_BY_PRODUCT")

        Return ds
    End Function


    Public Function GetOrderListByCusIDSupIDSortRefSortRangeOrderNo(ByVal customerID As Integer, ByVal supID As Integer, ByVal sortRef As Integer, ByVal sortRange As Integer, ByVal orderNo As String, ByVal status As Byte, ByVal startRecord As Integer, ByVal maxRecords As Integer) As DataSet
        Dim sqlCommand As New SqlClient.SqlCommand

        sqlCommand.CommandText = "[GetOrderListByCusIDSupIDSortRefSortRangeOrderNo]"
        sqlCommand.CommandType = System.Data.CommandType.StoredProcedure
        sqlCommand.Connection = Me.Connection
        sqlCommand.Transaction = Me.Transaction

        sqlCommand.Parameters.Add("@CUSTOMER_ID_FK", customerID)
        sqlCommand.Parameters.Add("@SUPPLIER_ID_FK", supID)
        sqlCommand.Parameters.Add("@SORT_REF_ID_FK", sortRef)
        sqlCommand.Parameters.Add("@SORT_RANGE_ID_FK", sortRange)
        sqlCommand.Parameters.Add("@ORDER_NO", orderNo)
        sqlCommand.Parameters.Add("@STATUS", status)

        Dim ds As New DataSet

        Dim da As New SqlDataAdapter(sqlCommand)

        da.Fill(ds, startRecord, maxRecords, "ORDER_SELECTS")

        Return ds
    End Function

    Public Function GetOrderList(ByVal customerID As Integer, ByVal orderNo As String, ByVal status As Byte, ByVal startRecord As Integer, ByVal maxRecords As Integer) As DataSet
        Dim sqlCommand As New SqlClient.SqlCommand

        sqlCommand.CommandText = "[GetOrderListByCustomerAndOrderNo]"
        sqlCommand.CommandType = System.Data.CommandType.StoredProcedure
        sqlCommand.Connection = Me.Connection
        sqlCommand.Transaction = Me.Transaction

        sqlCommand.Parameters.Add("@CUSTOMER_ID_FK", customerID)
        sqlCommand.Parameters.Add("@ORDER_NO", orderNo)
        sqlCommand.Parameters.Add("@STATUS", status)

        Dim ds As New DataSet

        Dim da As New SqlDataAdapter(sqlCommand)

        da.Fill(ds, startRecord, maxRecords, "ORDER_SELECTS")

        Return ds
    End Function

    Protected Overrides Function getDeleteCommand() As System.Data.SqlClient.SqlCommand
        Dim sqlCommand As New SqlClient.SqlCommand

        sqlCommand.CommandText = "[OrderDeleteCommand]"
        sqlCommand.CommandType = System.Data.CommandType.StoredProcedure
        sqlCommand.Connection = Me.Connection
        sqlCommand.Transaction = Me.Transaction

        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, False, CType(0, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ORDER_ID_PK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ORDER_ID_PK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ADJUSTED_APRROVED_BY_ID_FK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ADJUSTED_APRROVED_BY_ID_FK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ADJUSTED_BY_ID_FK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ADJUSTED_BY_ID_FK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ADJUSTED_DATE", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ADJUSTED_DATE", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_APPROVAL_DATE", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "APPROVAL_DATE", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_CONTAINERS", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CONTAINERS", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_CONTAINER_TYPE", System.Data.SqlDbType.TinyInt, 1, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CONTAINER_TYPE", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_CREATED_BY", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CREATED_BY", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_CREATED_DATE", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CREATED_DATE", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_CUSTOMER_ID_FK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CUSTOMER_ID_FK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_DESTINATION_PORT_ID_FK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "DESTINATION_PORT_ID_FK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ETA_DATE1", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ETA_DATE1", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ETA_DATE2", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ETA_DATE2", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ORDER_BY_ID_FK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ORDER_BY_ID_FK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ORDER_DATE", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ORDER_DATE", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ORDER_ITEM_TYPE", System.Data.SqlDbType.TinyInt, 1, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ORDER_ITEM_TYPE", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ORDER_NUMBER", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ORDER_NUMBER", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ORDER_TYPE", System.Data.SqlDbType.TinyInt, 1, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ORDER_TYPE", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_PACKING_TYPE", System.Data.SqlDbType.TinyInt, 1, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "PACKING_TYPE", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_REQUESTED_ETA", System.Data.SqlDbType.TinyInt, 1, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "REQUESTED_ETA", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_SHIPPING_INSTRUCTIONS", System.Data.SqlDbType.VarChar, 2000, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "SHIPPING_INSTRUCTIONS", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_SHIPPING_TYPE", System.Data.SqlDbType.TinyInt, 1, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "SHIPPING_TYPE", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_SORT_RANGE_ID_FK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "SORT_RANGE_ID_FK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_SORT_REF_ID_FK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "SORT_REF_ID_FK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_SORT_REF2_ID_FK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "SORT_REF2_ID_FK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_STATUS", System.Data.SqlDbType.TinyInt, 1, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "STATUS", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_SUPPLIER_ID_FK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "SUPPLIER_ID_FK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_UPDATED_BY", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "UPDATED_BY", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_UPDATED_DATE", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "UPDATED_DATE", System.Data.DataRowVersion.Original, Nothing))

        Return sqlCommand
    End Function

    Protected Overrides Function getInsertCommand() As System.Data.SqlClient.SqlCommand
        Dim sqlCommand As New SqlClient.SqlCommand

        sqlCommand.CommandText = "[OrderInsertCommand]"
        sqlCommand.CommandType = System.Data.CommandType.StoredProcedure
        sqlCommand.Connection = Me.Connection
        sqlCommand.Transaction = Me.Transaction

        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, False, CType(0, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ORDER_TYPE", System.Data.SqlDbType.TinyInt, 1, "ORDER_TYPE"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ORDER_NUMBER", System.Data.SqlDbType.VarChar, 10, "ORDER_NUMBER"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@CUSTOMER_ID_FK", System.Data.SqlDbType.Int, 4, "CUSTOMER_ID_FK"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@DESTINATION_PORT_ID_FK", System.Data.SqlDbType.Int, 4, "DESTINATION_PORT_ID_FK"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@SUPPLIER_ID_FK", System.Data.SqlDbType.Int, 4, "SUPPLIER_ID_FK"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@SORT_REF_ID_FK", System.Data.SqlDbType.Int, 4, "SORT_REF_ID_FK"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@SORT_REF2_ID_FK", System.Data.SqlDbType.Int, 4, "SORT_REF2_ID_FK"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@SORT_RANGE_ID_FK", System.Data.SqlDbType.Int, 4, "SORT_RANGE_ID_FK"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@REQUESTED_ETA", System.Data.SqlDbType.TinyInt, 1, "REQUESTED_ETA"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ETA_DATE1", System.Data.SqlDbType.DateTime, 8, "ETA_DATE1"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ETA_DATE2", System.Data.SqlDbType.DateTime, 8, "ETA_DATE2"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@CONTAINERS", System.Data.SqlDbType.Int, 4, "CONTAINERS"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@CONTAINER_TYPE", System.Data.SqlDbType.TinyInt, 1, "CONTAINER_TYPE"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@PACKING_TYPE", System.Data.SqlDbType.TinyInt, 1, "PACKING_TYPE"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@SHIPPING_TYPE", System.Data.SqlDbType.TinyInt, 1, "SHIPPING_TYPE"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ORDER_DATE", System.Data.SqlDbType.DateTime, 8, "ORDER_DATE"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ORDER_BY_ID_FK", System.Data.SqlDbType.Int, 4, "ORDER_BY_ID_FK"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@SHIPPING_INSTRUCTIONS", System.Data.SqlDbType.VarChar, 2000, "SHIPPING_INSTRUCTIONS"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@STATUS", System.Data.SqlDbType.TinyInt, 1, "STATUS"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@CREATED_DATE", System.Data.SqlDbType.DateTime, 8, "CREATED_DATE"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@CREATED_BY", System.Data.SqlDbType.Int, 4, "CREATED_BY"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@UPDATED_DATE", System.Data.SqlDbType.DateTime, 8, "UPDATED_DATE"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@UPDATED_BY", System.Data.SqlDbType.Int, 4, "UPDATED_BY"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ADJUSTED_BY_ID_FK", System.Data.SqlDbType.Int, 4, "ADJUSTED_BY_ID_FK"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ADJUSTED_DATE", System.Data.SqlDbType.DateTime, 8, "ADJUSTED_DATE"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ADJUSTED_APRROVED_BY_ID_FK", System.Data.SqlDbType.Int, 4, "ADJUSTED_APRROVED_BY_ID_FK"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@APPROVAL_DATE", System.Data.SqlDbType.DateTime, 8, "APPROVAL_DATE"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ORDER_ITEM_TYPE", System.Data.SqlDbType.TinyInt, 1, "ORDER_ITEM_TYPE"))

        Return sqlCommand
    End Function

    Protected Overrides Function getSelectCommand(ByVal keys() As Object) As System.Data.SqlClient.SqlCommand
        Dim sqlCommand As New SqlClient.SqlCommand

        sqlCommand.CommandText = "[OrderSelectCommand]"
        sqlCommand.CommandType = System.Data.CommandType.StoredProcedure
        sqlCommand.Connection = Me.Connection
        sqlCommand.Transaction = Me.Transaction

        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, False, CType(0, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, Nothing))
        Dim param As SqlParameter
        param = New SqlClient.SqlParameter("@ORDER_ID_PK", System.Data.SqlDbType.Int, 4, "ORDER_ID_PK")
        param.Value = keys(0)
        sqlCommand.Parameters.Add(param)

        Return sqlCommand
    End Function

    Protected Overrides Function getUpdateCommand() As System.Data.SqlClient.SqlCommand
        Dim sqlCommand As New SqlClient.SqlCommand

        sqlCommand.CommandText = "[OrderUpdateCommand]"
        sqlCommand.CommandType = System.Data.CommandType.StoredProcedure
        sqlCommand.Connection = Me.Connection
        sqlCommand.Transaction = Me.Transaction

        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, False, CType(0, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ORDER_TYPE", System.Data.SqlDbType.TinyInt, 1, "ORDER_TYPE"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ORDER_NUMBER", System.Data.SqlDbType.VarChar, 10, "ORDER_NUMBER"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@CUSTOMER_ID_FK", System.Data.SqlDbType.Int, 4, "CUSTOMER_ID_FK"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@DESTINATION_PORT_ID_FK", System.Data.SqlDbType.Int, 4, "DESTINATION_PORT_ID_FK"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@SUPPLIER_ID_FK", System.Data.SqlDbType.Int, 4, "SUPPLIER_ID_FK"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@SORT_REF_ID_FK", System.Data.SqlDbType.Int, 4, "SORT_REF_ID_FK"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@SORT_REF2_ID_FK", System.Data.SqlDbType.Int, 4, "SORT_REF2_ID_FK"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@SORT_RANGE_ID_FK", System.Data.SqlDbType.Int, 4, "SORT_RANGE_ID_FK"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@REQUESTED_ETA", System.Data.SqlDbType.TinyInt, 1, "REQUESTED_ETA"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ETA_DATE1", System.Data.SqlDbType.DateTime, 8, "ETA_DATE1"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ETA_DATE2", System.Data.SqlDbType.DateTime, 8, "ETA_DATE2"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@CONTAINERS", System.Data.SqlDbType.Int, 4, "CONTAINERS"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@CONTAINER_TYPE", System.Data.SqlDbType.TinyInt, 1, "CONTAINER_TYPE"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@PACKING_TYPE", System.Data.SqlDbType.TinyInt, 1, "PACKING_TYPE"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@SHIPPING_TYPE", System.Data.SqlDbType.TinyInt, 1, "SHIPPING_TYPE"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ORDER_DATE", System.Data.SqlDbType.DateTime, 8, "ORDER_DATE"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ORDER_BY_ID_FK", System.Data.SqlDbType.Int, 4, "ORDER_BY_ID_FK"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@SHIPPING_INSTRUCTIONS", System.Data.SqlDbType.VarChar, 2000, "SHIPPING_INSTRUCTIONS"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@STATUS", System.Data.SqlDbType.TinyInt, 1, "STATUS"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@CREATED_DATE", System.Data.SqlDbType.DateTime, 8, "CREATED_DATE"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@CREATED_BY", System.Data.SqlDbType.Int, 4, "CREATED_BY"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@UPDATED_DATE", System.Data.SqlDbType.DateTime, 8, "UPDATED_DATE"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@UPDATED_BY", System.Data.SqlDbType.Int, 4, "UPDATED_BY"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ADJUSTED_BY_ID_FK", System.Data.SqlDbType.Int, 4, "ADJUSTED_BY_ID_FK"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ADJUSTED_DATE", System.Data.SqlDbType.DateTime, 8, "ADJUSTED_DATE"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ADJUSTED_APRROVED_BY_ID_FK", System.Data.SqlDbType.Int, 4, "ADJUSTED_APRROVED_BY_ID_FK"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@APPROVAL_DATE", System.Data.SqlDbType.DateTime, 8, "APPROVAL_DATE"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ORDER_ITEM_TYPE", System.Data.SqlDbType.TinyInt, 1, "ORDER_ITEM_TYPE"))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ORDER_ID_PK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ORDER_ID_PK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ADJUSTED_APRROVED_BY_ID_FK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ADJUSTED_APRROVED_BY_ID_FK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ADJUSTED_BY_ID_FK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ADJUSTED_BY_ID_FK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ADJUSTED_DATE", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ADJUSTED_DATE", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_APPROVAL_DATE", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "APPROVAL_DATE", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_CONTAINERS", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CONTAINERS", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_CONTAINER_TYPE", System.Data.SqlDbType.TinyInt, 1, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CONTAINER_TYPE", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_CREATED_BY", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CREATED_BY", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_CREATED_DATE", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CREATED_DATE", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_CUSTOMER_ID_FK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "CUSTOMER_ID_FK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_DESTINATION_PORT_ID_FK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "DESTINATION_PORT_ID_FK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ETA_DATE1", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ETA_DATE1", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ETA_DATE2", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ETA_DATE2", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ORDER_BY_ID_FK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ORDER_BY_ID_FK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ORDER_DATE", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ORDER_DATE", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ORDER_ITEM_TYPE", System.Data.SqlDbType.TinyInt, 1, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ORDER_ITEM_TYPE", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ORDER_NUMBER", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ORDER_NUMBER", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_ORDER_TYPE", System.Data.SqlDbType.TinyInt, 1, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "ORDER_TYPE", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_PACKING_TYPE", System.Data.SqlDbType.TinyInt, 1, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "PACKING_TYPE", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_REQUESTED_ETA", System.Data.SqlDbType.TinyInt, 1, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "REQUESTED_ETA", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_SHIPPING_INSTRUCTIONS", System.Data.SqlDbType.VarChar, 2000, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "SHIPPING_INSTRUCTIONS", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_SHIPPING_TYPE", System.Data.SqlDbType.TinyInt, 1, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "SHIPPING_TYPE", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_SORT_RANGE_ID_FK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "SORT_RANGE_ID_FK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_SORT_REF_ID_FK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "SORT_REF_ID_FK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_SORT_REF2_ID_FK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "SORT_REF2_ID_FK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_STATUS", System.Data.SqlDbType.TinyInt, 1, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "STATUS", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_SUPPLIER_ID_FK", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "SUPPLIER_ID_FK", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_UPDATED_BY", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "UPDATED_BY", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_UPDATED_DATE", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "UPDATED_DATE", System.Data.DataRowVersion.Original, Nothing))
        sqlCommand.Parameters.Add(New System.Data.SqlClient.SqlParameter("@ORDER_ID_PK", System.Data.SqlDbType.Int, 4, "ORDER_ID_PK"))

        Return sqlCommand
    End Function
End Class
